package net.bplaced.streetfighter.lib.async.task;

import net.bplaced.streetfighter.lib.service.CommentPostServiceImpl;
import net.bplaced.streetfighter.lib.utils.CallBack;
import net.bplaced.streetfighter.lib.utils.ServiceReturnPackage;
import android.content.Context;

/**
 * @author Sebastian Hoffmann <bo.hoffi@googlemail.com>
 */
public class CommentPostTask
        extends AbstractLoaderTask<String, ServiceReturnPackage<String>> {

    public CommentPostTask(Context context, String progressMessage, CallBack<ServiceReturnPackage<String>> onFinished) {

        super(context, progressMessage, onFinished);
    }

    @Override
    ServiceReturnPackage<String> performInBackground(String... params) {

        if (params.length != 6) {
            return null;
        }

        return new CommentPostServiceImpl().postCommentViaPost(params[0], params[1], params[2], params[3], params[4],
                params[5]);
    }
}